<%@ Page language="c#" AutoEventWireup="false" Inherits="FlexWiki.Web.Rename" %>
<%@ Register TagPrefix="Forums" Namespace="AspNetForums.Controls" Assembly="AspNetForums.Controls" %>
<HTML>
  <HEAD>
    <Forums:Style runat="server" ID="Style2" />
    <title>Channel9 Wiki</title>
	</HEAD>
	<body class='Dialog'>
		<form runat="server" ID="Form1">
			<Forums:PageTemplate ID="template" Runat="server">
				<ContentTemplate>	
				<%
				if (Request.HttpMethod == "POST")
				{
					Response.Write("<h2>Rename: " + OldName  + "</h2><div class='pad'>");
					PerformRename();
					Response.Write("</div>");
				}
				else
				{
				%>
					<h2>Rename: <%= AbsTopicName.Name  %></h2>
					<div class="pad">
						<p><b>Important guidelines</b> (rename is not always straightforward!):
							<ul>
								<li>
									When you rename a topic, you can ask to have references to the topic 
									automatically updated.
									<ul>
										<li>
										References from other namespaces are not updated
										<li>
										Plural references are not found
									</ul>
								<li>
								Because not all references can be reliably found (e.g., because a topic has 
								been bookmarked by someone, referenced from another namespace), a page will be 
								automatically generated that tells people where the new page is.
								<li>
								Often when you rename a topic you are changing its meaning. As a result, you 
								might want to change the text surrounding the references to the topic; please 
								consider reviewing the current references when you're done renaming to be sure 
								they still make sense.
							</ul>
							<hr noshade size='1'>
							<form id="RenameForm" method="post" ACTION="rename.aspx">
								<input style='display: none' type="text"  name="oldName" value ="<%= AbsTopicName.Name  %>">
								<b>Old</b> name:
								<%= AbsTopicName.Name  %>
								<br />
								<b>New</b> name: <input style='font-size: x-small' type="text"  name="newName" value ="<%= AbsTopicName.Name  %>">
								<p>
									<table cellspacing=0 cellpadding=0><tr><td><input type="checkbox" id="fixup" name="fixup"></td><td><label for="fixup">Automatically update references</label></td></tr></table>
									<div style='display: none'>
										<br />
										<input type="checkbox" checked id="leaveRedirect" name="leaveRedirect"><label for="leaveRedirect">Generate 
											a redirect page under the old name</label>
									</div>
								</p>
								<p>
									<input style='display: none' type="text"  name="namespace" value ="<%= AbsTopicName.Namespace  %>">
									<input type='submit' ID="SaveButton" Value="Rename" />
								</p>
							</form>
					<%}%>
					</ContentTemplate>
			</Forums:PageTemplate>
		</form>
	</body>
</HTML>
